home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
038a
/
bas_int1.zip
/
DRIVINFO.BAS
< prev
next >
Wrap
BASIC Source File
|
1991-06-04
|
2KB
|
53 lines
'================================================================
' Quick Basic Forum
' Date : 24-May-91
' From : Bob Perkins
'Subject : Re: Call Interrupt
'Well, I just wrote this little program to read the drive parms for my
'two floppies. Maybe it'll work on your system. Does not need anything
'in the drive to work. You should be able to figure out the drive type
'from the info returned.
'=======================================================================
'$INCLUDE: 'qb.bi'
DIM regs AS regtype
'INT 13 - DISK - GET CURRENT DRIVE PARAMETERS (XT,AT,XT286,CONV,PS)
' AH = 08h
' DL = drive number
'Return: CF set on error
' AH = status code (see AH=1 above)
' BL = drive type (see AH=17h below) (AT/PS2 floppies only)
' DL = number of consecutive acknowledging drives
' DH = maximum value for head number
' CL = maximum value fo sector number
' CH = maximum value for cylinder number
' ES:DI = drive parameter table
'---------------------------------------------
CLS
FOR x% = 0 TO 1
regs.dx = x%
regs.ax = &H800
CALL interrupt(&H13, regs, regs)
PRINT
PRINT "Drive Number :"; x%
PRINT "Drive Type :"; regs.bx AND &HFF
PRINT "Drive Status :"; (regs.ax AND &HFF00) \ 256
PRINT "Maximum Head Number :"; (regs.dx AND &HFF00) \ 256
PRINT "Maximum Sector Number :"; regs.cx AND &HFF
PRINT "Maximum Cylinder Number :"; (regs.cx AND &HFF00) \ 256
NEXT x%
END
'Sorry, forgot to include the drive type stuff.. (Where it says refer to
'AH=17h) If there is no diskette in the drive I would guess that it
'returns the type of the last diskette. Here you go:
' Disk type:
' 00h = no disk
' 01h = regular disk in regular drive
' 02h = regular disk in high-capacity drive
' 03h = high-capacity disk in high-capacity drive
' 04h = 720K disk in 720K drive